<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增档案')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-record-add">
        	<input name="demographyId" type="hidden">
        	<h4 class="form-header h4">档案信息</h4>
        	<div class="row">
        		<div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required">研究对象：</label>
                        <div class="col-sm-8">
                        	<input name="demographyName" id="demographyName" onclick="queryPerson()"  class="form-control" type="text" maxlength="30" readonly required>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">研究课题：</label>
                        <div class="col-sm-8">
                            <select name="topId" class="form-control m-b">
				                <option th:each="topic : ${topicList}" th:text="${topic.topicName}" th:value="${topic.topicId}" ></option>
				            </select>
                        </div>
                    </div>
                </div>
        	</div>
        	<div class="row">
        		<div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required">检查时间：</label>
                        <div class="col-sm-8">
                        	<div class="input-group date">
		                        <input name="checkTime" class="form-control" placeholder="yyyy-MM-dd" th:value="${#dates.format(now,'yyyy-MM-dd')}" type="text" readonly required>
		                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
		                    </div>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">中心号：</label>
                        <div class="col-sm-8">
                            <input name="centerNo" class="form-control" type="text" maxlength="10" required>
                        </div>
                    </div>
                </div>
        	</div>
        	<div class="row">
        		<div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required">筛选号：</label>
                        <div class="col-sm-8">
                        	<input name="screeningNo" class="form-control" type="text" maxlength="10" required>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">随机号：</label>
                        <div class="col-sm-8">
                            <input name="randomNo" class="form-control" type="text" maxlength="10" required>
                        </div>
                    </div>
                </div>
        	</div>
        </form>
    </div>
    
    <div class="row">
        <div class="col-sm-offset-5 col-sm-10">
            <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
            <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "kt/record"
        $("#form-record-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.saveTab(prefix + "/add", $('#form-record-add').serialize());
            }
        }

        $("input[name='checkTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
        
        function queryPerson(){        	
        	var url = prefix + "/queryPerson/";
			$.modal.open("选择人口学", url);
        }
        
    </script>
</body>
</html>